package cn.edu.sgu.www.mhxysy.dto.children;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class ChildrenDTO implements DataTransferObject {

    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 子女名字
     */
    @NotBlank(message = "子女名字" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "子女名字")
    private String name;

    /**
     * 子女等级
     */
    @Range(min = 0, max = 125, message = "子女等级" + CustomMessages.ILLEGAL)
    @NotNull(message = "子女等级" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "子女等级")
    private Integer grade;

    /**
     * 健康度
     */
    @PositiveOrZero(message = "健康度" + CustomMessages.ILLEGAL)
    @NotNull(message = "健康度" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "健康度")
    private Integer healthiness;

    /**
     * 角色ID
     */
    @Pattern(regexp = RegExps.ROLE_ID, message = "角色ID" + CustomMessages.ILLEGAL)
    @NotBlank(message = CustomMessages.ROLE_ID_NOT_NULL)
    @ApiModelProperty(value = "角色ID")
    private String roleId;

    /**
     * 门派ID
     */
    @Positive(message = "门派ID" + CustomMessages.ILLEGAL)
    @NotNull(message = CustomMessages.SCHOOL_ID_NOT_NULL)
    @ApiModelProperty(value = "门派ID")
    private Integer schoolId;

    /**
     * 子女造型ID
     */
    @Positive(message = "子女造型ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "子女造型" + CustomMessages.ID_NOT_NULL)
    @ApiModelProperty(value = "子女造型ID")
    private Integer categoryId;

    /**
     * 提升次数
     */
    @Range(min = 0, max = 3, message = "提升次数" + CustomMessages.ILLEGAL)
    @NotNull(message = "提升次数" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "提升次数")
    private Integer improveTimes;
}